package cn.laixueit.mapper;

import cn.laixueit.pojo.Student;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StudentMapper {

    @Select("select * from student")
    public List<Student> findAll();


    @Select("select * from student where id = #{id}")
    Student findById(Integer id);


    @Insert("insert into student(username,address) values(#{username},#{address})")
    @Options(keyColumn = "id",keyProperty = "id",useGeneratedKeys = true)
    void add(Student student);


}
